import React, { Component } from 'react';
import { List, Avatar, Icon } from 'antd';


export default class House extends Component {

  UNSAFE_componentWillMount = () => {
    this.props.listPage({ current: 1 });
  }

  render() {
    const { ok, page, loading } = this.props;
    return (
         <List
          loading={loading.effects['house/listPage']}
          itemLayout="vertical"
          size="default"
          pagination={{
            onChange: (page) => {
              this.props.listPage({current: page})
            },
            position: 'both',
            current: page.current,
            pageSize: page.size,
            total: page.total
          }}
          dataSource={page.records}
          footer={null}
          renderItem={item => (
            <List.Item
              key={item.houseId}
              extra={<img width={80} height={60} alt="logo" src={item.houseImg||'http://erp.fangline.cn/image/default_error_houseImg.png'} />}
            >
              <List.Item.Meta
                avatar={<Avatar src={item.avatar} />}
                title={<a >{item.section}</a>}
                description={item.createTimeYYMMDDStr}
              />
              {item.content}
            </List.Item>
          )}
        />
    )
  }
}

